<?php

// $Id: article.php 3 2010-05-27 16:25:49Z alistair.mills@btinternet.com $

   session_start();

include ("functions.php");

   $thisscript = $HTTP_SERVER_VARS["PHP_SELF"]; // link to this php file
   $path_parts = pathinfo($thisscript);
   $root_dir   = $path_parts["dirname"];
   $host       = "http://".$HTTP_SERVER_VARS['SERVER_NAME'];

   if (isset($_SESSION["history"])) {
       $history = $_SESSION["history"];
   }  else {
       $_SESSION["history"] = $history;
   }

   $sort = "";
   if ($_SERVER['REQUEST_METHOD'] == "GET") {
       if (isset($_GET["sort"])) $sort = $_GET["sort"];
   }

   $month = "1";
   $year  = "2001";
   $cat   = "act";
   if ($_SERVER['REQUEST_METHOD'] == "GET") {
       if (isset($_GET["month"])) $month = $_GET["month"];
       if (isset($_GET["year"]))  $year  = $_GET["year"];
       if (isset($_GET["cat"]))   $cat   = $_GET["cat"];
       if (isset($_GET["pres"]))  $pres  = $_GET["pres"];
   }

    $db = db_open($host);

    if ($db) {

       $translators = build_index ("SELECT * FROM translators","trans", "translator" );
       $months      = build_index ("SELECT * FROM months",     "mon",    "month" );
       $categories  = build_index ("SELECT * FROM categories", "cat",    "category" );

       $sql =
          'SELECT * FROM contents where category = "'. $cat .'" and year = ' .$year. ' and month = ' .$month ;

       $sql_        = addslashes($sql);
       $sql__       = get_magic_quotes_runtime() ? $sql_ : $sql;
       $reponse     = mysql_query($sql__) or die(mysql_error());

       $translator  = "unknown";
       $title       = "unknown";
       $text        = "";

       $un_film     = mysql_fetch_assoc($reponse);
       $title       = $un_film["title"];
       $translator  = $un_film["translator"];
       $date        = $un_film["file_date"];
       $text        = $un_film["text"];

       mysql_free_result($reponse);

       $translator  = $translators [$translator];
       $category    = $categories  [$cat];
       $m           = sprintf("%02d", (int) $month);
       $mois        = $months      [$m];
    }

?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

    <meta name="description" content="French Lessons">
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>La Guinguette - <?php echo "$year - $mois - $category"; ?></title>
    <link href="../../style.css" rel="stylesheet" type="text/css">

<style type="text/css">
<!--
p {
    color: Black;
}
-->
</style>

</head>


<body bgcolor="#FFFFFF" background="../back.gif" text="#008000" link="#0000FF" vlink="#0000FF">
<a href="./index.php"><img src="../../up.gif" alt="up" width="36" height="18"></a>
<h1>Article de La Guinguette - <?php echo "$year - $mois - $category"; ?> </h1>

<?php
include ("navigate_table.php");

       echo '<table>';
       echo $text;
       echo '</table>';
?>

<hr>
      <p lang="EN">With questions or for more information, please contact Alistair Mills <a href="mailto:alistair.mills@btinternet.com"> alistair.mills@btinternet.com</a><br>
      Updated <!-- #BeginDate format:Sw1 --> Wednesday 10th December 2008  <!-- #EndDate --></p>
      <a href="http://validator.w3.org/check?uri=referer">
        <img
        src="http://www.w3.org/Icons/valid-html401-blue"
        alt="Valid HTML 4.01 Transitional" height="31" width="88">
      </a>


<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-2273668-1";
urchinTracker();
</script>

</body>
</html>
